<template>
  <van-pull-refresh
    v-model="isLoading"
    success-text="刷新成功"
    @refresh="onRefresh"
  >
    <slot></slot>
  </van-pull-refresh>
</template>
<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      count: 0,
      isLoading: false,
    };
  },
  props: {
    refreshData: Function,
  },

  methods: {
    onRefresh() {
      setTimeout(() => {
        this.refreshData();
        Toast("刷新成功");
        this.isLoading = false;
      }, 1000);
    },
  },
};
</script>